<div align="center"><h2>Добавить Запись</h2>
<form name="questbook" action="" method="post">
		<table>
					<tr>
						<td>
						Имя:
						</td>
						<td>
							<input type="text" name="name" />
						</td>
					</tr>
					
					<tr>
						<td>
						Комментарий:
						</td>
						<td>
							<input type="text" name="comment" />
						</td>
					</tr>
					
					<tr>
						<td colspan="2">
									<input type="submit" name="button_questbook" value="Добавить" />
						</td>
					</tr>
		</table>
</form></div>
<h2>Записи в гостевой книге</h2>
<div>
		<?php
			if (!empty($_POST["button_questbook"])) {
					$name = htmlspecialchars($_POST["name"]);
					$comment = htmlspecialchars($_POST["comment"]);
					if	((strlen($name) < 3) || (strlen($comment) < 3)) $success = false;
					else $success = addQuestBookComment ($name, $comment);
					if (!$success) {
						$alert="Ошибка при добавлении новой записи!";
						include "alert.php";
					}
					
			}
		
			$comments = getAllQuestBookComments();
			for ($i = 0; $i < count($comments); $i++) {
				$name = $comments[$i]["name"];
				$comment = $comments[$i]["comment"];
				
				include "blocks/questbook_comment.php";
				
				
			}
		?>
		
</div>

